package com.atguigu.lease.common.exception;


import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class HasRoomException extends RuntimeException {
    //异常装填的编码
    private Integer code;


    //需要一个构造函数

    public HasRoomException(String message, Integer code) {
        //调用父类的构造方法
        super(message);
        this.code = code;
    }

    public HasRoomException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
